package com.peza.bikelog.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.peza.bikelog.business.dao.BikelogDao;
import com.peza.bikelog.business.service.BikelogService;
import com.peza.bikelog.common.domain.LogEntry;

@Service ("bikelogService")
public class BikelogServiceImpl implements BikelogService{


	@Autowired
	private BikelogDao dao;
	
	@Override
	public LogEntry getLogEntry(Long id){
		return dao.getLogEntry(id);
	}
	
	@Override
	public void saveLogEntry(LogEntry le){
		dao.save(le);
	}
	
	@Override
	public void deleteLogEntry(Long id){
		LogEntry entry = getLogEntry(id);
		entry.setVisible(false);
	}

	@Override
	public List<LogEntry> getLogEntryRange(Long fromId, Long toId) {
		return dao.getLogEntryRange(fromId, toId);
	}
	
}
